<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('http://yoursite.com').hostname,
    root: '/',
    scheme: 'Pisces',
    version: '7.7.1',
    exturl: false,
    sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: '',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="在学习Auto.js时发现安卓的Intent(意图) 是一个很方便的东西，可以跳过模拟点击很多步骤而直接实现功能，比如微信发朋友圈，发微博；  Intent(意图) 是一个消息传递对象，您可以使用它从其他应用组件请求操作。  123456789101112131415161718192021222324252627282930313233343536373839404142434445464748">
<meta property="og:type" content="article">
<meta property="og:title" content="安卓&#x2F;Android-跳转到新浪微博[转]">
<meta property="og:url" content="http://yoursite.com/2020/03/04/%E5%AE%89%E5%8D%93/Android-%E8%B7%B3%E8%BD%AC%E5%88%B0%E6%96%B0%E6%B5%AA%E5%BE%AE%E5%8D%9A[%E8%BD%AC]/index.html">
<meta property="og:site_name" content="unltra">
<meta property="og:description" content="在学习Auto.js时发现安卓的Intent(意图) 是一个很方便的东西，可以跳过模拟点击很多步骤而直接实现功能，比如微信发朋友圈，发微博；  Intent(意图) 是一个消息传递对象，您可以使用它从其他应用组件请求操作。  123456789101112131415161718192021222324252627282930313233343536373839404142434445464748">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-03-04T14:18:11.406Z">
<meta property="article:modified_time" content="2020-02-02T07:06:59.000Z">
<meta property="article:author" content="unltra">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://yoursite.com/2020/03/04/%E5%AE%89%E5%8D%93/Android-%E8%B7%B3%E8%BD%AC%E5%88%B0%E6%96%B0%E6%B5%AA%E5%BE%AE%E5%8D%9A[%E8%BD%AC]/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>安卓/Android-跳转到新浪微博[转] | unltra</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">unltra</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>Home</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>Archives</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="en">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/03/04/%E5%AE%89%E5%8D%93/Android-%E8%B7%B3%E8%BD%AC%E5%88%B0%E6%96%B0%E6%B5%AA%E5%BE%AE%E5%8D%9A[%E8%BD%AC]/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://s2.ax1x.com/2020/02/04/1BYxFx.jpg">
      <meta itemprop="name" content="unltra">
      <meta itemprop="description" content="unltra-blog">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="unltra">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          安卓/Android-跳转到新浪微博[转]
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-03-04 22:18:11" itemprop="dateCreated datePublished" datetime="2020-03-04T22:18:11+08:00">2020-03-04</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">Edited on</span>
                <time title="Modified: 2020-02-02 15:06:59" itemprop="dateModified" datetime="2020-02-02T15:06:59+08:00">2020-02-02</time>
              </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>在学习Auto.js时发现安卓的<code>Intent(意图)</code> 是一个很方便的东西，可以跳过模拟点击很多步骤而直接实现功能，比如微信发朋友圈，发微博；</p>
<blockquote>
<p>Intent(意图) 是一个消息传递对象，您可以使用它从其他应用组件请求操作。</p>
</blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 调起新浪微博客户端的发送微博界面，完成发送微博工作</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> content 微博内容</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openSendWeibo</span><span class="params">(Activity activity,String content)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>||<span class="keyword">null</span>==content)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://sendweibo?content="</span>+URLEncoder.encode(content)));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 调起新浪微博客户端的发送微博界面，完成发送微博工作</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> activity </span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> content 微博内容</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> xid 签到时 的地点id</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> poiId POI点ID</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> poiName POI点名称</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> longitude 经度</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> latitude 纬度</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openSendWeibo</span><span class="params">(Activity activity,String content,String xid,String poiId,String poiName,String longitude,String latitude)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://sendweibo?content="</span>+content+<span class="string">"&amp;xid="</span>+xid+<span class="string">"&amp;poiid="</span>+poiId+<span class="string">"&amp;poiname="</span>+poiName+<span class="string">"&amp;longitude="</span>+longitude+<span class="string">"&amp;latitude="</span>+latitude));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 调用当前用户的周边的人的界面</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openNearbyPeople</span><span class="params">(Activity activity)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://nearbypeople"</span>));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 调用当前用户的周边的微博的界面</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openNearbyWeibo</span><span class="params">(Activity activity)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://nearbyweibo"</span>));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     *通过昵称 打开个人资料页面</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> nickName 昵称</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openUserInfoByNickName</span><span class="params">(Activity activity,String nickName)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line"><span class="comment">//        intent.setData(Uri.parse("sinaweibo://userinfo?nick="+URLEncoder.encode(nickName)));</span></span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://userinfo?nick="</span>+nickName));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 通过uid打开个人资料界面</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> uid</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openUserInfoByUid</span><span class="params">(Activity activity,String uid)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://userinfo?uid="</span>+uid));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 打开微博客户端内置浏览器</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> url 要打开的网页地址</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openWeiboBrowser</span><span class="params">(Activity activity,String url)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://browser?url="</span>+url));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 打开微博客户端</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openWeibo</span><span class="params">(Activity activity)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://splash"</span>));</span><br><span class="line"> </span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 打开摇一摇界面</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openShake</span><span class="params">(Activity activity)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://shake"</span>));</span><br><span class="line"> </span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 打开通讯录界面</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openContact</span><span class="params">(Activity activity)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://contact"</span>));</span><br><span class="line"> </span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">        </span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 打开用户话题列表界面</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> uid 用户uid</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openUserTrends</span><span class="params">(Activity activity,String uid)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://usertrends?uid="</span>+uid));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 打开私信对话界面</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> uid 用户uid</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openMessageListByUid</span><span class="params">(Activity activity,String uid)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://messagelist?uid="</span>+uid));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 打开私信对话界面</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> uid 用户uid</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openMessageListByNickName</span><span class="params">(Activity activity,String nickName)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://messagelist?nick="</span>+(nickName)));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 打开某条微博正文</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> activity</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> blogId 某条微博id</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">openDetail</span><span class="params">(Activity activity,String blogId)</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(activity==<span class="keyword">null</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        Intent intent=<span class="keyword">new</span> Intent();</span><br><span class="line">        intent.setAction(Intent.ACTION_VIEW);</span><br><span class="line">        intent.addCategory(<span class="string">"android.intent.category.DEFAULT"</span>);</span><br><span class="line">        intent.setData(Uri.parse(<span class="string">"sinaweibo://detail?mblogid="</span>+blogId));</span><br><span class="line">        activity.startActivity(intent);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>————————————————<br>版权声明：本文为CSDN博主「csc_1024」的原创文章，遵循 CC 4.0 BY-SA 版权协议，转载请附上原文出处链接及本声明。<br>原文链接：<a href="https://blog.csdn.net/csclmf/article/details/78632926" target="_blank" rel="noopener">https://blog.csdn.net/csclmf/article/details/78632926</a></p>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/03/04/%E8%BD%AF%E4%BB%B6%E5%8F%8A%E5%B0%8F%E5%B7%A5%E5%85%B7/%E5%8F%B2%E4%B8%8A%E6%9C%80%E5%85%A8%E7%BD%91%E5%9D%80%E5%AF%BC%E8%88%AA%E5%A4%A7%E5%85%A8%EF%BC%8C%E8%AE%A9%E4%B8%96%E4%B8%8A%E6%B2%A1%E6%9C%89%E6%89%BE%E4%B8%8D%E5%88%B0%E7%9A%84%E5%A5%BD%E4%B8%9C%E8%A5%BF/" rel="prev" title="软件及小工具/史上最全网址导航大全，让世上没有找不到的好东西">
      <i class="fa fa-chevron-left"></i> 软件及小工具/史上最全网址导航大全，让世上没有找不到的好东西
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/03/07/Linux/Centos7%E9%98%B2%E7%81%AB%E5%A2%99%E9%85%8D%E7%BD%AE/" rel="next" title="Linux/Centos7防火墙配置">
      Linux/Centos7防火墙配置 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="unltra"
      src="https://s2.ax1x.com/2020/02/04/1BYxFx.jpg">
  <p class="site-author-name" itemprop="name">unltra</p>
  <div class="site-description" itemprop="description">unltra-blog</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">9</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/unltra" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;unltra" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">unltra</span>
</div>
<div style="width:300px;margin:0 auto; padding:0 0;" align="center">
<a target="_blank" href="http://www.beian.miit.gov.cn/" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">
<p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">浙ICP备17019849号-1</p></a>
</div>
<div style="width:300px;margin:0 auto; padding:0 0;" align="center">
  <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33021202000572" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">
  <img src="https://s2.ax1x.com/2019/12/18/QHme9s.png" style="float:left;"/>
<p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">浙公网安备 33021202000572号</p></a>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> v4.2.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">Theme – <a href="https://pisces.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a> v7.7.1
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
